package com.zln.hello;
/**
 * 演示三元运算符
 */
public class TermaryOperator {
    public static void main (String[] args){
        int a = 10;
        int b = 99;
        int result = a > b ? a++ : b--;
        System.out.println("result=" + result + " a = " + a + " b = " + b);

        /**
         * 解读：
         * 1. a > b 为false
         * 2.返回b--，先返回b的值，然后再 b-1
         * 3、返回的结果是99
         * 运行结果：result=99 a = 10 b = 98
         */
    }
}
